package com.obelisco.modelo.dao.hibernate;

import java.io.Serializable;
import java.util.List;

import com.obelisco.modelo.dao.IRolDAO;
import com.obelisco.modelo.data.Rol;

public class RolDAO extends HibernateDAO  implements IRolDAO {

	public Rol findByPK(Serializable clave) {
		try {
        	Rol data = (Rol) getHibernateTemplate().load(Rol.class,clave);
			return data.getEstado().equals("B") ?  null : data;        	
        } catch (RuntimeException re) {
            throw re;
        }		
	}

	public List loadAll() {
		try {
			List lista = getHibernateTemplate().find(
			"from Rol rol where rol.estado != 'B'");
			return lista;	
        } catch (RuntimeException re) {
            throw re;
        }		
	}

	public void delete(Rol objeto) {
		// TODO Auto-generated method stub

	}

	public void save(Rol objeto) {
		// TODO Auto-generated method stub

	}

	public List findByProperty(String propertyName, Object value) {
		// TODO Auto-generated method stub
		return null;
	}

}
